<html>
<body>
<h1>Mathdroid</h1>

<h2>Contents</h2>
<ul>
    <li><a href="#overview">Overview</a>
    <li><a href="#built_in_functions">Built-in functions</a>
    <li><a href="#constants_and_variables">Constants and variables</a>
    <li><a href="#on_screen_buttons">Using the on-screen buttons</a>
    <li><a href="#history">History</a>
    <li><a href="#settings">Settings</a>
    <li><a href="#finding_out_more">Finding out more</a>
</ul>

<a name="overview"><h2>Overview</h2></a>

<p>Mathdroid is an algebraic calculator that supports:

<ul>
<li>Arithmetic (+, -, *, /).
<li>Exponentiation (^).
<li>Remainder (%).
<li>Factorial (postfix !).
<li>Relational operators (==, !=, &lt;, &lt;=, &gt;, &gt;=).
<li>Bitwise operations (&amp;, |, ~, &lt;&lt;, &gt;&gt;).
<li>Boolean logic (&amp;&amp;, ||).
<li>Matrices.
<li>Variable assignment (=).
<li>A wide range of mathematical functions (see below).
</ul>

<p>Usual operator precedence ("order of operations") is followed, and parentheses are supported.

<p>Numbers can be given in decimal (<code>123</code>), binary (<code>0b1011</code>), octal (<code>0o777</code>), and hex (<code>0xfffe</code>).

<p>The boolean type has two values: <code>true</code> and <code>false</code>.

<p>The list type is an arbitrary sequence of values: <code>[1, 2, 3]</code>.
Lists are used to represent vectors.
Lists may include nested lists, allowing the construction of matrices and tensors: <code>[[1, 2], [3, 4]]</code>.

<p>The constants <code>e</code> (2.718...) and <code>pi</code> (3.14...) are predefined.

<p>The special variable <code>Ans</code> returns the result of the previous calculation.

<a name="built_in_functions"><h2>Built-in functions</h2></a>

<p>There are also all the usual built-in functions. Here's an alphabetical list:

$$BUILT_IN_FUNCTION_LIST$$

<p>Where a function has an operator form, it's given in parentheses.
For example, <code>BitShiftLeft(1, 32)</code> and <code>1 &lt;&lt; 32</code> are equivalent.

<p>Although the function names given above contain capital letters, <code>isprime</code> is equivalent to <code>IsPrime</code> but easier to type on phone keyboards.
If you have a convenient underscore key and value readability, you can insert an underscore between words: so <code>is_prime</code> is equivalent to <code>IsPrime</code>.

<p>All trigonometric functions use radians or degrees, depending on the current angle mode setting. (See <a href="#settings">Settings</a>.)

$$BUILT_IN_FUNCTION_HELP$$

<a name="constants_and_variables"><h2>Constants and variables</h2></a>

<p>All constant and variable names, whether built-in or user-defined, are case-insensitive.
<code>Ans</code> and <code>ans</code> are equivalent, as are <code>pi</code> and <code>Pi</code> (and <code>PI</code> and <code>pI</code>).

<p>You can assign to a variable with an expression like <code>t = 4</code>.

<p>It is not possible to assign a new value to a constant, nor the special variable <code>Ans</code>.

<a name="on_screen_buttons"><h2>Using the on-screen buttons</h2></a>

<p>Most of the buttons should be familiar from pocket calculators you've used before.

<p>The EXE ("execute") button is used to actually perform a calculation.

<p>The EXP button is used to enter numbers in engineering notation, such as <code>1.2E6</code>, which is the same as <code>1.2*10^6</code>.
The EXP button provides the "E".
If you're using your device's keyboard, you can just type E.

<p>The Ans button is used to refer to the previous answer.
It can be thought of as a variable whose value changes after each calculation.
For example, executing <code>1</code> and then repeatedly executing <code>2*Ans</code> will result in 1, 2, 4, 8, 16, et cetera.

<p>The "2nd" button is used to switch the special function buttons (sin, cos, et cetera) to their second set of functions.
Unlike pocket calculators, the "2nd" button is sticky; it changes to say "1st", and you have to press it again to go back.
(On a pocket calculator, pressing any other button generally resets.)

<p>If your device has a trackball, you can use that to move the caret in the text field. Otherwise, left and right cursor keys are provided.

<a name="history"><h2>History</h2></a>

<p>A press on an item in the history copies that entry back into the input. This is useful for repeating or editing an earlier calculation.

<p>A long press on an item in the history brings up a context menu. This menu has options to retype the selected input, copy the selected input and output to the clipboard, copy the entire history to the clipboard, forget (remove) the selected item, or forget the entire history.

<a name="settings"><h2>Settings</h2></a>

<p><i>Angle mode</i> lets you choose whether trigonometric functions use degrees or radians (the default).

<p><i>Haptic feedback</i> lets you choose whether or not the device should vibrate when on-screen keys are pressed.

<p><i>Continuation mode</i> causes "Ans" to be automatically inserted when an operator (such as "*") is typed at the start of an expression. For example, in normal mode, "1*2", EXE, followed by "*3", EXE, gives an error because "*3" is meaningless. In continuation mode, the act of typing "*3" causes "Ans*3" to be inserted, giving the presumably desired result.

<p>Why isn't this the default? Primarily because "-" is ambiguous. It's both a unary and a binary operator: the negative sign or the subtraction operator. Repeating the previous example with "-" instead of "*", typing "-3" might mean "subtract 3 from the previous result" (that is, "Ans-3"), but it might also mean "start a new calculation where the first term is -3" (as in "-3+12").

<p>If you're in continuation mode and need to start a new calculation with "-", work-arounds include "0-3" or "(-3)". (An alternative would be for Mathdroid to exclude "-" from continuation; feedback appreciated.)

<a name="finding_out_more"><h2>Finding out more</h2></a>

<p>Mathdroid is free software. You can find the source code or report bugs at <a href="http://code.google.com/p/enh/">http://code.google.com/p/enh/</a>.
</body>
</html>
